<template>
  <div id="app">
    <h1>需支付：<span>¥9165.00</span></h1>
    <ul>
      <li @click="_choosePay">余额支付 <span class="grayColor">(可用余额：¥985642.56)</span><i :class="{'active':isActive}"></i>
      </li>
      <li @click="_choosePay">银行卡支付<i :class="{'active':!isActive}"></i></li>
    </ul>
    <div class="bean">
      <p>我的金豆：396.56 <span class="baseColor">(该订单最多可抵扣：¥2749.35)</span></p>
      <input type="text" placeholder="请输入要抵扣的金豆">
    </div>
    <footer>
       <router-link to="/paymentResult">确认支付  ¥9165.00</router-link>
    </footer>
  </div>
</template>

<script>
  export default {
    name: "payment",
    beforeCreate() {
      document.querySelector('body').setAttribute('style', 'background-color:#f3f3f3')
    },

    beforeDestroy() {
      document.querySelector('body').removeAttribute('style')
    },
    data() {
      return {
        isActive: true
      }
    },
    methods: {
      _choosePay() {
        this.isActive = !this.isActive
      }
    }
  }
</script>

<style lang="less" scoped>
  #app {
    h1 {
      font-weight: normal;
      font-size: 0.554rem;
      text-align: center;
      line-height: 2.66rem;
      background: #f9eedf;
      color: #ff5400;
      span {
        font-size: 0.85rem;
      }
    }
    ul {
      background: #ffffff;
      margin-top: 1.23rem;
      li {
        margin: 0 0.5rem;
        line-height: 2.66rem;
        font-size: 0.597rem;
        &:nth-of-type(2) {
          border-top: 1px solid #e5e5e5;
        }
        i {
          float: right;
          width: 0.7rem;
          height: 0.7rem;
          border: 1px solid #e5e5e5;
          border-radius: 50%;
          margin-top: 0.95rem;
          background: #f6f6f6;
          &.active {
            background: url("../../../assets/images/check-solid.png");
            background-size: 100%;
            border: 0;
          }
        }
      }
    }
    .bean {
      background: #fff;
      padding: 0.5rem;
      margin-top: 1.23rem;
      p {
        font-size: 0.55rem;
        margin : 0.5rem 0 0 0.5rem;
        span {
          font-size: 0.47rem;
        }
      }
      input {
        width: 100%;
        height: 1.83rem;
        background: #f6f6f6;
        outline: none;
        border: 0;
        padding-left: 0.5rem;
        margin: 0.5rem 0 0.7rem;
        box-sizing: border-box;
        font-size: 0.55rem;
      }
    }
    footer {
      position: fixed;
      width: 100%;
      bottom: 0;
      background: #ff9500;
      line-height: 2.176rem;
      text-align: center;
      max-width: 750px;
      a {
        color: #fff;
        font-size: 0.768rem;
        display: block;
      }
    }
  }
</style>
